package ooday03.Animal02;

public class Test {
    public static void main(String[] args) {

        Duck yazi = new Duck("唐老鸭","鸭");
        yazi.fly();
        yazi.run();
        Bird[] niao = new Bird[1];


        niao[0] =new Bird("大嘴鸥","鸟");
        for (int i = 0; i < niao.length ; i++) {
            System.out.println(niao[0].name);
            niao[i].fly();
            niao[i].run();
        }


        Cat[] cats = new Cat[2];
        cats[0] = new Cat("小花","猫");
        cats[1] = new Cat("汤姆","猫");
        for (int i = 0; i < cats.length ; i++) {
            System.out.println(cats[i].name);
            cats[i].run();
        }

    }
}
